Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: smaller container image #279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hegerdes
Copy link

What changed

This PR uses multi-stage builds to reduce the container image size.

The container build file now copies all installed (and possibly compiled) dependencies to the final layer without keeping the build tools.

Not included in the final image are

  • gcc build-essential curl git
  • build-caches manpages
  • .git .github Dockerfile

Uncompressed size difference: 4.37GB vs 3.79GB. A reduction of 600MB that dont have to be stored and transfered over the network anymore.

Tests

Ich created a file based diff after each image layer and compared the changed files. All changed files that are needed are still copied over to the final image.

I stated the image build with and without the USE_CUDA_DOCKER. The resulting image started with no problem

Signed-off-by: Henrik Gerdes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant